package com.heima.controller;

import com.heima.pojo.Business;
import com.heima.service.BusinessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/api/vm-service/businessType")
public class BusinessController {
    @Autowired
    private BusinessService businessService;

    @GetMapping
    public List<Business> listQuery(){
        return businessService.listQuery();
    }


    @GetMapping("/name/{businessId}")
    public String queryBusinessName(@PathVariable Integer businessId){
        log.info("获取商圈名字：{}",businessId);
        return businessService.queryBusinessName(businessId);
    }
}
